﻿using Repository.Core.Models.Dto;
using Repository.Core.Models.Queries;
using Repository.Core.Models.VO;
using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.Applications.Models;
using MiniFox.Platform;

namespace Repository.Core.Providers
{
    [AutoRegister]
    public interface IVersionProvider
    {
        ResultObject<IEnumerable<VersionSetVo>> Query(string repoName, PagedQueryObject<CommonQuery> request);
        
        ResultObject<IEnumerable<VersionItemVo>> VersionItems(string repoName, string versionSetName, PagedQueryObject<VersionQuery> request);
        
        VersionItemVo GetItem(string repoName, string versionSetName, long? versionId);
        
        bool Sync(string repoName, SystemIdentity user);

        bool Pull(string repoName, SystemIdentity user, string versionSetName, long? versionId);

        bool Commit(string repoName, SystemIdentity user, CommitDto dto);

        bool CheckOut(string repoName, SystemIdentity user, string versionSetName);

        string GetItemContent(string repoName, string versionSetName, long versionId);
    }
}
